<div class="ibox-content">
    <form id="signupForm" class="form-horizontal m-t" method="post" action="{:\\think\\Url::build('AuthManager/userToGroup')}">
        <div class="form-group">
            <div class="checkbox col-sm-10">
                {volist name="auth_groups" id="vo"}
                <label><input class="auth_groups" type="checkbox" name="group_id[]" value="{$vo.id}">{$vo.title}(编号：{$vo.id})</label>
                {/volist}
            </div>
        </div>
        <div class="form-group">
            <div class=" col-sm-10">
                <button class="btn btn-primary" type="submit">提交</button>
                <input type="hidden" name="uid" value="{$user_id|default=''}"/>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="__JS__/plugins/validate/jquery.validate.min.js"></script>
<script type="text/javascript">
    $(function () {
        var group = [{$user_groups}];
        $('.auth_groups').each(function () {
            if ($.inArray(parseInt(this.value, 10), group) > -1) {
                $(this).prop('checked', true);
            }
        });
        $("#signupForm").validate({
            submitHandler: function () {
                validateAjax("#signupForm", "button[type='submit']");
                return false;
            }
        });
    });

</script>
